Skip to content

Azure setup: grant only Application.ReadWrite.OwnedBy - #471

Merged
bengreenberg5 merged 3 commits into
mainfrom
ben/azure-minimal-graph-permissions
Aug 31, 2026
Merged

Azure setup: grant only Application.ReadWrite.OwnedBy#471
bengreenberg5 merged 3 commits into
mainfrom
ben/azure-minimal-graph-permissions

Conversation

@bengreenberg5

@bengreenberg5 bengreenberg5 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Companion to https://github.com/porter-dev/code/pull/8155 — RUN-4375: Least-privileged Azure permissions for ModelML.

Porter's only Microsoft Graph operation is managing FICs on its own app registration, so the setup script now grants a single, ownership-scoped permission (Application.ReadWrite.OwnedBy) instead of seven tenant-wide ones.

Merge after https://github.com/porter-dev/code/pull/8155 is deployed.

Script changes

  • add_api_permissions grants only Application.ReadWrite.OwnedBy.
  • New ensure_app_owner makes the service principal an owner of its own app registration (az ad app owner add) — OwnedBy only reaches registrations the caller owns.
  • Order in main: create_app_registration → assign_custom_role → ensure_app_owner → add_api_permissions → grant_admin_consent → create_federated_credential. Removing the legacy tenant-wide permissions is deliberately NOT part of setup — revocation could break a working connection; ModelML will get a one-time swap procedure instead.

Docs

cloud-accounts/connecting-a-cloud-account.mdx describes the new steps and what the single permission does.

🤖 Generated with Claude Code

Porter's only Microsoft Graph operation is managing federated identity
credentials on its own app registration. The script granted seven tenant-wide
Graph permissions inherited from the client-secret era; replace them with
Application.ReadWrite.OwnedBy, make the service principal an owner of its own
app registration (OwnedBy only reaches registrations the caller owns), and
remove the legacy grants — manifest entries and consented app role
assignments — from app registrations that still carry them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3cL9QN3RQYJ3R8zTiervJ
@mintlify

mintlify Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
porter 🟢 Ready View Preview Aug 28, 2026, 5:37 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Revoking the seven tenant-wide permissions is out of scope for setup: a
setup script should only grant, and stripping permissions could break a
working connection (the backend still accepts Application.ReadWrite.All).
Existing customers who want to shed the legacy grants get a one-time
swap procedure instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3cL9QN3RQYJ3R8zTiervJ
Comment thread cloud-accounts/connecting-a-cloud-account.mdx Outdated
@bengreenberg5
bengreenberg5 merged commit ee17b0c into main Aug 31, 2026
2 checks passed
@bengreenberg5
bengreenberg5 deleted the ben/azure-minimal-graph-permissions branch August 31, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants